#pragma once
#include "FileDescriptorFwd.h"
#include "FileProxy.h"
#include "Iterator.h"
#include "PathFwd.h"

namespace ja2{ namespace vfs
{
	//! Interface for directory.
	class IDirectory : boost::noncopyable
	{
		// Typedefs
	public:
		typedef Iterator<FileProxy, FileProxy> Iterator;

		// Operations
	public:
		//! Get path of directory.
		virtual boost::filesystem::path const &get_path() const = 0;
		//! Get file.
		virtual FileProxy get_file(boost::filesystem::path const &Path) const = 0;
		//! File exist.
		virtual bool file_exist(boost::filesystem::path const &Path) const = 0;
		//! Get all subdirectories.
		virtual PathVector_t get_sub_dirs() const = 0;
		//! Add file descriptor.
		virtual void add_file(FileDescriptorPtr_t const &pFileDesc, bool bDeleteOldFile = false) = 0;
		//! Create new subdirectory.
		virtual void create_subdirectory(boost::filesystem::path const &SubDir) = 0;
		//! Delete subdirectory.
		virtual void delete_subdirectory(boost::filesystem::path const& Dir) = 0;
		//! Delete file.
		virtual void delete_file(boost::filesystem::path const& File) = 0;
		//! Get beginning file iterator.
		virtual Iterator begin() = 0;
		//! Get ending file iterator.
		virtual Iterator end() = 0;
	};
} /*vfs*/} /*ja2*/
